//
//  PhoneNumButton.m
//  PayTest_01
//
//  Created by 古俊杰 on 2016/10/27.
//  Copyright © 2016年 古俊杰. All rights reserved.
//

#import "PhoneNumButton.h"
#import "UIView+Category.h"

@interface PhoneNumButton ()

@property (nonatomic, strong) UILabel *numLabel;

@end


@implementation PhoneNumButton

-(void)awakeFromNib
{
    [super awakeFromNib];
    
    [self setupViews];
}

- (void)setupViews
{
    UILabel *numLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 60 * 0.5, Main_Screen_Width/3 - 2, 60 * 0.5)];
    self.numLabel = numLabel;
    numLabel.font = [UIFont systemFontOfSize:10];
//    numLabel.backgroundColor = [UIColor redColor];
    numLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:numLabel];
    
    self.titleLabel.font = [UIFont systemFontOfSize:32];
}

-(void)setPhoneNumberText:(NSString *)phoneNumberText
{
    _phoneNumberText = phoneNumberText;
    
    self.numLabel.text = phoneNumberText;
}

-(void)setHighlighted:(BOOL)highlighted
{
    if (highlighted)
    {
        self.numLabel.alpha = 0.3f;
        self.titleLabel.alpha = 0.3f;
        
        [self setbackgroundImage:[UIImage imageNamed:@"U脉电话-数字底-点击"]];
        
    } else
    {
        self.numLabel.alpha = 1.0f;
        self.titleLabel.alpha = 1.0f;
        
        [self setbackgroundImage:[UIImage imageNamed:@""]];
    }
}
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
 
    return self;
}
@end
